<!DOCTYPE html>
<html style="height: 100%">
   <head>
       <meta charset="utf-8">
       <title>锦屏县人口分布</title>
       <meta name="renderer" content="webkit">
       <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
       <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
   </head>
   <body style="height: 100%; margin: 0">
       <div id="container" style="height: 70%"></div>
       <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js"></script>
       <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-gl/dist/echarts-gl.min.js"></script>
       <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-stat/dist/ecStat.min.js"></script>
       <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/dist/extension/dataTool.min.js"></script>
       <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/map/js/china.js"></script>
       <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/map/js/world.js"></script>
       <!-- <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=xfhhaTThl11qYVrqLZii6w8qE5ggnhrY&__ec_v__=20190126"></script> -->
       <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/dist/extension/bmap.min.js"></script>
    <!-- <script src="https://www.echartsjs.com/examples/vendors/jquery/jquery.js"></script> -->
    <script src="../jinping-map/echarts.min.js"></script>
    <script src="../jinping-map/qiandongnan.js?i=8"></script>
    <!-- <script src="./HK.js"></script> -->
       <script type="text/javascript">
var dom = document.getElementById("container");
var myChart = echarts.init(dom);
var app = {};
option = null;
myChart.showLoading();

// $.get(ROOT_PATH + 'data/asset/geo/HK.json', function (geoJson) {
// $.get('./HK.json', function (geoJson) {

    myChart.hideLoading();

    echarts.registerMap('JP', geoJson);

    myChart.setOption(option = {
        title: {
            text: '锦屏县人口密度（2019）',
            subtext: '人口密度数据来自Wikipedia',
            sublink: 'http://zh.wikipedia.org/wiki/%E9%A6%99%E6%B8%AF%E8%A1%8C%E6%94%BF%E5%8D%80%E5%8A%83#cite_note-12'
        },
        tooltip: {
            trigger: 'item',
            formatter: '{b}<br/>{c} (人)'
        },
        toolbox: {
            show: true,
            orient: 'vertical',
            left: 'right',
            top: 'center',
            feature: {
                dataView: {readOnly: false},
                restore: {},
                saveAsImage: {}
            }
        },
        visualMap: {
            min: 800,
            max: 300000,
            text: ['High', 'Low'],
            realtime: false,
            calculable: true,
            inRange: {
                color: ['lightskyblue', 'yellow', 'orangered']
            }
        },
        series: [
            {
                name: '锦屏县18乡镇人口密度',
                type: 'map',
                mapType: 'JP', // 自定义扩展图表类型
                label: {
                    show: true
                },
                data: [
                    {name: '锦屏', value: 230570},
                    {name: '大同乡', value: 18000},
                ],
                // 自定义名称映射
                nameMap: {
                    'Jinping': '锦屏',
                    'Datong': '大同乡',
                    'Tonggu': '铜鼓镇',
                    'Dunzhai': '敦寨镇',
                    // 'Kwai Tsing': '葵青',
                    // 'Kwun Tong': '观塘',
                    // 'North': '北区',
                    // 'Sai Kung': '西贡',
                    // 'Sha Tin': '沙田',
                    // 'Sham Shui Po': '深水埗',
                    // 'Southern': '南区',
                    // 'Tai Po': '大埔',
                    // 'Tsuen Wan': '荃湾',
                    // 'Tuen Mun': '屯门',
                    // 'Wan Chai': '湾仔',
                    // 'Wong Tai Sin': '黄大仙',
                    // 'Yau Tsim Mong': '油尖旺',
                    // 'Yuen Long': '元朗'
                }
            }
        ]
    });
// });;
if (option && typeof option === "object") {
    myChart.setOption(option, true);
}
       </script>
   </body>
</html>
